import urllib.request as request

url = "http://www.baidu.com"
response = request.urlopen(url)

print(type(response))

content = response.read().decode("utf-8")

# print(content)

print(response.getheaders())

# read readline readlines getcode geturl getheaders